#ifndef TAPP_H
#define TAPP_H

#ifndef STRICT
#define STRICT
#endif


#include "twin.h"



class TApp {
protected:
	static TWin			**wndArray;
	static int			wndCnt;
	static TWin			*SearchWnd(HWND hW);
	static BOOL			SearchWndIndex(TWin *win, int *index);
	static void			AddWinSub(TWin *win);

	HINSTANCE			hCtl3d;
	LPSTR				cmdLine;
	int					nCmdShow;
	TWin				*mainWnd;

	virtual BOOL		InitApp(void);

public:
	TApp(HINSTANCE _hI, LPSTR _cmdLine, int _nCmdShow);
	virtual ~TApp();
	virtual void		InitWindow() = 0;
	virtual int			Run();

	static	BOOL		PreProcMsg(MSG *msg);
	static TWin			*preWnd;
	static char			*defaultClass;
	static HINSTANCE	hI;
	static void			AddWin(TWin *win);
	static void			AddWinByWnd(TWin *win, HWND hWnd);
	static void			DelWin(TWin *win);
	static LRESULT CALLBACK WinProc(HWND hW, UINT uMsg, WPARAM wParam, LPARAM lParam);
};


#endif